

import java.util.Arrays;

public class ComponenteConex implements Comparable<ComponenteConex>{
	public int cantidad;
	public Integer[] nodoInit;
	public int color;
	public int blancos;
	public int negros;
	
	public ComponenteConex(int colorReemplazo, Integer[] newXY) {
		this.cantidad = 0;
		this.color = colorReemplazo;
		this.nodoInit = newXY;
	}

	public int compareTo(ComponenteConex o) {
		if(this.cantidad > o.cantidad){
			return 1;
		}
		if(this.cantidad == o.cantidad){
			return 0;
		}
		return -1;
	}

	@Override
	public int hashCode() {
		final int prime = 31;
		int result = 1;
		result = prime * result + cantidad;
		result = prime * result + color;
		result = prime * result + Arrays.hashCode(nodoInit);
		return result;
	}

	@Override
	public boolean equals(Object obj) {
		if (this == obj)
			return true;
		if (obj == null)
			return false;
		if (getClass() != obj.getClass())
			return false;
		ComponenteConex other = (ComponenteConex) obj;
		if (cantidad != other.cantidad)
			return false;
		if (color != other.color)
			return false;
		if (!Arrays.equals(nodoInit, other.nodoInit))
			return false;
		return true;
	}


}
